testsuite: Add icontheme tests for generic fallback
authorMatthias Clasen <mclasen@redhat.com>
Tue, 13 May 2014 13:23:53 +0000 (15:23 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 14 May 2014 02:28:36 +0000 (04:28 +0200)
testsuite/gtk/icontheme.c

index b32d6227313454a3906c414c36bdef76ed76ba1b..03927086f98e5d920ca06348dfec6805b872b4bb 100644 (file)
@@ -106,6 +106,29 @@ test_basics (void)
   g_test_assert_expected_messages ();
 }
 
+static void
+test_generic_fallback (void)
+{
+  /* simple test for generic fallback */
+  assert_icon_lookup ("simple-foo-bar",
+                      16,
+                      GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+                      "/icons/16x16/simple.png");
+
+  /* Check generic fallback also works for symbolics falling back to regular items */
+  assert_icon_lookup ("simple-foo-bar-symbolic",
+                      16,
+                      GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+                      "/icons/16x16/simple.png");
+
+  /* Check we fall back to more generic symbolic icons before falling back to
+   * non-symbolics */
+  assert_icon_lookup ("everything-justregular-symbolic",
+                      SCALABLE_IMAGE_SIZE,
+                      GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+                      "/icons/scalable/everything-symbolic.svg");
+}
+
 static void
 test_force_symbolic (void)
 {
@@ -212,6 +235,7 @@ main (int argc, char *argv[])
   gtk_test_init (&argc, &argv);
 
   g_test_add_func ("/icontheme/basics", test_basics);
+  g_test_add_func ("/icontheme/generic_fallback", test_generic_fallback);
   g_test_add_func ("/icontheme/force-symbolic", test_force_symbolic);
   g_test_add_func ("/icontheme/force-regular", test_force_regular);